import { ProcessDiagramApi, ProcessDiagramVO } from '@/api/manu/processdiagram'
import { handleTree } from '@/utils/tree'

export interface ProcessMappingVo{
  id: number
  versionId: number
  processMasterSeq: number
  processSubSeq: number
  stepSourceId: number
  materialInputList:string
  informationInput:string
  processOutputPic:number
  operatingCate:string 
  withTrace:boolean
  mpLevel:number
  kcOrCC:string
  cycleTime:number
  stationId:number
  requirement:string
}

export interface processMappingPointVo{
  id: number
  symbolSize: number[]
  value: number[]
}

export const processMappingApi = {
  getProcessMappingByMasterId : async (id: number) => {
    const list = ref<ProcessDiagramVO[]>([]) 
    const queryParams = reactive({
      versionId: id,
    })
    try {
      const data = await ProcessDiagramApi.getProcessDiagramList(queryParams)
      list.value = data
    }catch(error){
      console.error(error)
    }
    return list
  }
}